import request from '@/router/axios';
import  qs from  'qs'

//删除
export const delRowCountry = (id) => {
  return request({
    url: '/api/blade-public/dictCountry/delete',
    method: 'post',
    params: {
      id,
    }
  })
}
// 新增
export const addRowCountry = (row) => {
  row.parentid =row.parentid == ''? 0:row.parentid
  return request({
    url: '/api/blade-public/dictCommon/saveDict',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(row)
  })
}
// 保存
export const saveRowCountry = (row) => {
  return request({
    url: '/api/blade-public/dictCountry/save',
    method: 'post',
    headers:{
      "Content-Type":"application/json"
    },
    data: JSON.stringify(row)
  })
}
//编辑
export const editRowCountry = (row) => {
  return request({
    url: '/api/blade-public/dictCountry/edit',
    method: 'post',
    headers:{
      "Content-Type":"application/json"
    },
    data: JSON.stringify(row)
  })
}
// 查询
export const queryDictCountry = (params) => {
  return request({
    url: '/api/blade-public/dictCountry/query',
    method: 'post',
    data:params
  })
}

